<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<div id="test_edit" style="padding:10px 10px 10px 10px">
	<form id="testEditForm" method="post">
		<input type="hidden" name="id" value="${test.id }"/>
		<input type="hidden" name="caseNo" value="${test.caseNo}" />
		<input type="hidden" name="ponCase" value="${test.ponCase }" />
	    <table class="tm-tableAttr">
		    <tr class="tm-tableAttrSub">
		        <th colspan="14">测试用例</th>
		    </tr>
	        <tr>
	            <th>用例编号</th>
	            <td><input class="textbox" type="text" id="caseNo" disabled name="caseNo" value="${test.caseNo }"></input></td>
	        </tr>
	        <tr>
	    	
	       	<tr>
	    	<th>已具备自动化用例</th>
		    	<td><input class="textbox" type="text" id="autoUseCase" name="autoUseCase" value="${test.autoUseCase }"></input></td>
		    </tr>
		    <tr>
	    	<th>筛选/修改/添加</th>
		    	<td>
					<select class="combo .combo-text combo-arrow-hover" style="width:171px;" name="fma">
						<option value="" selected="${(test.fma==null||test.fma=='')?true:false }">请选择</option>
						<option value="筛选" selected="${test.fma=='筛选'?true:false }">筛选</option>
	            		<option value="修改" selected="${test.fma=='修改'?true:false }">修改</option>
	            		<option value="添加" selected="${test.fma=='添加'?true:false }">添加</option>
	            	</select>
				</td>
		    </tr>
		    <tr>
			<th>自动化状态</th>
				<td>
					<select class="combo .combo-text combo-arrow-hover" style="width:171px;" name="autoStatus">
						<option value="" selected="${(test.autoStatus==null||test.autoStatus=='')?true:false }">请选择</option>
						<option value="不可自动化" selected="${test.autoStatus=='不可自动化'?true:false }">不可自动化</option>
	            		<option value="可自动化，已调通" selected="${test.autoStatus=='可自动化，已调通'?true:false }">可自动化，已调通</option>
	            		<option value="可自动化，待集成测试提供" selected="${test.autoStatus=='可自动化，待集成测试提供'?true:false }">可自动化，待集成测试提供</option>
	            	</select>
				</td>
			</tr>
	    </table>
	</form>
	<div style="padding:5px">
	    <a href="javascript:void(0)" class="button" onclick="submitForm()">提交</a>
	    <a href="javascript:void(0)" class="button" onclick="redoForm()">取消</a>
	</div>
</div>
<script type="text/javascript">
	$(function(){
	});
	
function submitForm(){
	$.post("/test/edit",$("#testEditForm").serialize(), function(data){
		if(data.status==200){
			var id = data.data.id;
			var no = data.data.caseNo;
			$.ajax({
				url:'/test/querybyno',
				dataType:'html',
				data:{
					id:id,
					caseNo:no
				},
				success:function(data) {
					$('#test_edit').empty();
					$('#test_edit').append(data);
				}
			})
		}
	});
}
function redoForm(){
	var no = $('#caseNo').val();
	$.ajax({
		url:'/test/querybyno',
		dataType:'html',
		data:{
			caseNo:no
		},
		success:function(data) {
			$('#test_edit').empty();
			$('#test_edit').append(data);
		}
	})
}
</script>
